//
//  MineNetManager.m
//  digitalCurrency
//
//  Created by sunliang on 2018/1/26.
//  Copyright © 2018年 XinHuoKeJi. All rights reserved.
//

#import "MineNetManager.h"

@implementation MineNetManager

+(void)getInvestListWithDic:(NSMutableDictionary *)dic CompleteHandle:(void(^)(id resPonseObj,int code))completeHandle {
    NSString *path = @"CT/invest/getInvestListByuserId";
    [self ylNonTokenRequestWithGET:path parameters:dic successBlock:^(id resultObject, int isSuccessed) {
        completeHandle(resultObject,isSuccessed);
    }];
}
    
    
    //释放列表
+(void)getReleaseIncomeList:(NSDictionary *)dic CompleteHandle:(void(^)(id resPonseObj,int code))completeHandle {
    NSString *path = @"getTeamIncome?";
    [self requestWithGET:path parameters:dic successBlock:^(id resultObject, int isSuccessed) {
        completeHandle(resultObject,isSuccessed);
    }];
}
    // 释放汇总数据
+(void)getFlashsaleInfo:(NSDictionary *)dic CompleteHandle:(void(^)(id resPonseObj,int code))completeHandle {
    NSString *path = @"CT/invest/getFlashsaleInfo";
    [self ylNonTokenRequestWithGET:path parameters:dic successBlock:^(id resultObject, int isSuccessed) {
        completeHandle(resultObject,isSuccessed);
    }];
}

// 分享和社区收益
+(void)getInvestedIncomeLogs:(NSDictionary *)dic CompleteHandle:(void(^)(id resPonseObj,int code))completeHandle {
    NSString *path = @"CT/invest/getInvestedIncomeLogs";
    [self ylNonTokenRequestWithGET:path parameters:dic successBlock:^(id resultObject, int isSuccessed) {
        completeHandle(resultObject,isSuccessed);
    }];
}

//CE/invest/getCommunityInfo
+(void)getCommunityInfo:(NSDictionary *)dic CompleteHandle:(void(^)(id resPonseObj,int code))completeHandle {
    NSString *path = @"getManageIncome";
    [self ylNonTokenRequestWithGET:path parameters:dic successBlock:^(id resultObject, int isSuccessed) {
        completeHandle(resultObject,isSuccessed);
    }];
}

// 获取用户信息 不传id
+(void)getUserStarInfo:(NSString *)uid CompleteHandle:(void(^)(id resPonseObj,int code))completeHandle {
    NSString *path = @"getUser";
    NSMutableDictionary *dic = [NSMutableDictionary new];
//    dic[@"userId"] = uid;
    [self ylNonTokenRequestWithGET:path parameters:dic successBlock:^(id resultObject, int isSuccessed) {
        completeHandle(resultObject,isSuccessed);
    }];
}

//设置交易密码
+(void)moneyPasswordForJyPassword:(NSString *)jyPassword CompleteHandle:(void(^)(id resPonseObj,int code))completeHandle{
    NSString *path = @"setPayPassword";
    NSMutableDictionary *dic = [NSMutableDictionary new];
    dic[@"payPassword"] = jyPassword;
    [self ylNonTokenRequestWithGET:path parameters:dic successBlock:^(id resultObject, int isSuccessed) {
        completeHandle(resultObject,isSuccessed);
    }];
}
//获取重置交易密码的验证码
+(void)resetMoneyPasswordCodeForCompleteHandle:(void(^)(id resPonseObj,int code))completeHandle{
    NSString *path = @"sendUpdatePhoneMassage";
    NSMutableDictionary *dic = [NSMutableDictionary new];
    [self ylNonTokenRequestWithGET:path parameters:dic successBlock:^(id resultObject, int isSuccessed) {
        completeHandle(resultObject,isSuccessed);
    }];
}

//重置交易密码
+(void)resetMoneyPasswordForCode:(NSString *)code withNewPassword:(NSString *)newPassword CompleteHandle:(void(^)(id resPonseObj,int code))completeHandle{
    NSString *path = @"updatePayPassword";
    NSMutableDictionary *dic = [NSMutableDictionary new];
    dic[@"code"] = code;
    dic[@"payPassword"] = newPassword;
    [self ylNonTokenRequestWithGET:path parameters:dic successBlock:^(id resultObject, int isSuccessed) {
        completeHandle(resultObject,isSuccessed);
    }];
}

//获取重置登录密码的验证码
+(void)resetLoginPasswordCodeForCompleteHandle:(void(^)(id resPonseObj,int code))completeHandle{
    NSString *path = @"sendUpdatePhoneMassage";
    NSMutableDictionary *dic = [NSMutableDictionary new];
    [self ylNonTokenRequestWithGET:path parameters:dic successBlock:^(id resultObject, int isSuccessed) {
        completeHandle(resultObject,isSuccessed);
    }];
}

//重置登录密码
+(void)resetLoginPasswordForCode:(NSString *)code withOldPassword:(NSString *)oldPassword withLatestPassword:(NSString *)latestPassword CompleteHandle:(void(^)(id resPonseObj,int code))completeHandle{
    NSString *path = @"updatePassword";
    NSMutableDictionary *dic = [NSMutableDictionary new];
    dic[@"code"] = code;
    dic[@"oldPassword"] = oldPassword;
    dic[@"newPassword"] = latestPassword;
    [self ylNonTokenRequestWithGET:path parameters:dic successBlock:^(id resultObject, int isSuccessed) {
        completeHandle(resultObject,isSuccessed);
    }];
}

//账号设置的状态信息获取
+(void)accountSettingInfoForCompleteHandle:(void(^)(id resPonseObj,int code))completeHandle{
    NSString *path = @"selectPayPassword";
    NSMutableDictionary *dic = [NSMutableDictionary new];
    [self ylNonTokenRequestWithGET:path parameters:dic successBlock:^(id resultObject, int isSuccessed) {
        completeHandle(resultObject,isSuccessed);
    }];
}

//提币申请
+(void)mentionCoinApplyForUnit:(NSString *)unit withAddress:(NSString*)address withAmount:(NSString *)amount withFee:(NSString *)fee withRemark:(NSString *)remark withJyPassword:(NSString *)jyPassword mobilecode:(NSString *)mobilecode codeStr:(NSString *)codeStr CompleteHandle:(void(^)(id resPonseObj,int code))completeHandle{
    NSString *path = @"doChange";
    NSMutableDictionary *dic = [NSMutableDictionary new];
    dic[@"coinId"] = unit;
    dic[@"address"] = address;
    dic[@"amount"] = amount;
    dic[@"fee"] = fee;
    dic[@"jyPassword"] = jyPassword;
//    dic[@"userId"] = mobilecode;
    dic[@"code"] = codeStr;
    dic[@"remark"] = @"";
    [self ylNonTokenRequestWithGET:path parameters:dic successBlock:^(id resultObject, int isSuccessed) {
        completeHandle(resultObject,isSuccessed);
    }];
}

//版本更新
+(void)versionUpdateForId:(NSString *)ID  CompleteHandle:(void(^)(id resPonseObj,int code))completeHandle{
    NSString *path = @"checkIOSUpdate?";
    NSMutableDictionary *dic = [NSMutableDictionary new];
    
    [self requestWithGET:path parameters:dic successBlock:^(id resultObject, int isSuccessed) {
        completeHandle(resultObject,isSuccessed);
    }];
}

//资产流水
+(void)assettransactionParam:(NSDictionary *)param CompleteHandle:(void(^)(id resPonseObj,int code))completeHandle{
    NSString *path = [NSString stringWithFormat:@"%@%@",HOST,@"uc/asset/transaction/all"];
    NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithDictionary:param];
    
    [self requestWithPost:path header:nil parameters:dic successBlock:^(id resultObject, int isSuccessed) {
        completeHandle(resultObject,isSuccessed);
    }];
    
}

//用户协议
+(void)Userprotocol:(NSDictionary *)param CompleteHandle:(void(^)(id resPonseObj,int code))completeHandle{
    NSString *path = [NSString stringWithFormat:@"%@%@",HOST,@"uc/ancillary/more/help/detail"];
    
    NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithDictionary:param];
    
    [self requestWithPost:path header:nil parameters:dic successBlock:^(id resultObject, int isSuccessed) {
        completeHandle(resultObject,isSuccessed);
    }];
}

@end
